//
//  Person.h
//  OC2_实例变量可见度_方法
//
//  Created by Scott on 16/4/19.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Person : NSObject

#pragma mark - 实例变量
/** 声明实例变量部分. 
 * 可见度三种: public, protected(默认), private
 *
 * public: 外部和内部都能直接访问.
 * Protected: 内部和子类可以直接访问.
 * private: 只有内部可以直接访问.
 */
{
@public
    NSString *_name;
    
@protected
    NSString *_sex;
    NSInteger _age;
}


#pragma mark - Creating and Init

+ (instancetype)personWith:(NSString *)name
                       sex:(NSString *)sex
                       age:(NSInteger)age;

- (instancetype)initWithName:(NSString *)name
                         sex:(NSString *)sex
                         age:(NSInteger)age;

- (instancetype)initWithName:(NSString *)name;


#pragma mark - setter, getter

- (void)setName:(NSString *)name;
- (NSString *)name;

- (void)setSex:(NSString *)sex;
- (NSString *)sex;

- (void)setAge:(NSInteger)age;
- (NSInteger)age;



#pragma mark - other
/** 声明方法(功能) */

// 给_sex实例变量赋值的方法.
// 方法名: setterSex:
- (void)setterSex:(NSString *)sex;

// 写一个取出_sex实例变量值的方法
- (NSString *)getSex;


// 同时给_name, _sex, _age实例变量赋值
// 方法名: setName:setSex:setAge:
- (void)setName:(NSString *)name setSex:(NSString *)sex setAge:(NSInteger)age;






- (void)info;


@end
